<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>临时购物车</title>

<script src="jquery/js/jquery-1.8.2.js"></script>
<script src="jquery/js/jquery-ui-1.8.23.custom.js"></script>

<link rel="stylesheet"
	href="jquery/css/ui-lightness/jquery-ui-1.9.0.custom.css" />
<link href="css/shoppingCarAndMyCustom.css" type="text/css"
	rel="stylesheet" />
<link href="css/login.css" type="text/css" rel="stylesheet" />

<script type="text/javascript" src="js/address.js"></script>
<script type="text/javascript" src="js/login.js"></script>
<script type="text/javascript"
	src="js/myCustonAndShoppingCar/shoppingCar.js"></script>
<script type="text/javascript">
function showGetOrderContent() {
	if (readyToBuy == 1) {
		// 如果没有session，则提示登录
		//alert($("#showusersNamea").html());
		if($("#showusersNamea1").html()==""||$("#showusersNamea1").html()=='null'){
			alert("请在右上角处登录，登陆后可以保存您的设计");
			$("#login_level").show("slow");
		}else{
			var id_num=new Array();
			var checkbox=document.getElementsByName("checkbox1");
			for(var i=0;i<checkbox.length;i++){
				if(checkbox[i].checked){
					id_num[i]=checkbox[i].value+","+document.getElementById(i+",buyCount").value;
					//alert(id_num[i]);
				}
			}
			window.location.href = "updateCustomAtShop.action?receiveName="
					+ $("#username").val() + "&&receiveProvince="
					+ $("#selProvance").val() + "&&receiveCity="
					+ $("#selCity").val() + "&&area=" + $("#selArea").val()
					+ "&&address=" + $("#address").val() + "&&postCode="
					+ $("#mail").val() + "&&phone1=" + $("#specialplane1").val()
					+ "&&phone2=" + $("#specialplane2").val() + "&&mobilePhone="
					+ $("#telephone").val()+"&&id_num="+id_num;
		}
	} else {
		alert("请填写完整、正确");
	}
}
</script>
</head>
<body onload="loadData('selProvance','selCity','selArea')">
	<jsp:include page="top.jsp"></jsp:include>
	<br />
	<table>
		<tr>
			<td width="200px" valign="top">
				<table>
					<tr>
						<td>
							<h2 class="shoppingCar_left_maintitle">&nbsp;&nbsp;&nbsp;温馨提示</h2>
						</td>
					</tr>
					<tr>
						<td>
							<div class="shoppingCar_left_detail">
								&nbsp;&nbsp;未经注册的临时购物车，将不能保存定制设计的作品；同时购买成功之后不能在站内分享或者推广，也不能保留购买记录等。为了方便您的下次购买或跟朋友分享，敬请注册后登陆购物车操作购买或付款，谢谢！
							</div></td>
					</tr>
				</table></td>
			<td width="5%"></td>
			<td valign="top">
				<div class="shoppingCar_subtitle">
					&nbsp;&nbsp;购物车信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input
						type="checkbox" checked="checked" onclick="checkAll()"
						id="checkAllbox" /> 全选
				</div> <br />
				<table width="610px">
					<%
						int tt = 0;
					%>
					<c:forEach items="${cuslist}" var="r">
						<tr align="center">
							<td width="200px">
								<div class="shoppingCar_right_pic">
									<img src="${r.customPic}" width="200px" height="200px"
										name="shoppingcarpicture" id="shoppingcarpicture" />
								</div></td>
							<td>
								<div class="shoppingCar_right_pic">
									<div style="height:20px">
										编号：${r.customId}<br /> <input type="hidden"
											value="${r.customId}" name="customId" id="customId" />
									</div>
									<div style="height:20px">
										<input type="hidden" value="${r.customName}" name="IDmsg"
											id="IDmsg" />
										主题：${r.customName}<br />
									</div>
									<div style="height:20px">
										数量：<input type="text" value="1" style="width:80px;"
											onblur="checkNumber(<%=tt%>)" id="<%=tt%>,buyCount"
											name="buyCount" />（套）<br />
									</div>
									<div style="height:20px">
										价格：￥<font id="<%=tt%>jiageid">${r.customPrice}元</font><input
											type="hidden" value="${r.customPrice}" id="<%=tt++%>priceid" />
										<br />
									</div>
									<div style="height:20px">
										<c:if test="${r.userName}!='null'">户名：${r.userName }<br />
										</c:if>
									</div>
									<div style="height:20px">
										<c:if test="${r.receiveMobilephone}!='null'">电话：${r.receiveMobilephone }<br />
										</c:if>
									</div>
									<div style="height:20px">
										<c:if test="${r.customName}!='null'">地址：${r.receiveAddress }<br />
										</c:if>
										<br />
									</div>
									<div style="height:20px">
										设计时间：${r.customTime_bak}<br /> <input type="hidden"
											value="${r.customContent }" id="contentAtshop" />
									</div>
									<div style="height:20px">
										<input type="button" value="重设计"
											style="border:0;background-color:#94b8e9;"
											onclick="reDesignAtShoppingCar('${r.customId}')" />
										<%-- <input
											type="hidden" id="hiddendetail<%=tt++%>"
											value="${r.customPic},${r.customDetail}" /> --%>
									</div>
									<div style="height:20px">
										<input type="checkbox" checked="checked" name="checkbox1"
											id="checkbox1" name="checkbox1" value="${r.customId}" /> 付款
									</div>
								</div>
							</td>
						</tr>
					</c:forEach>
				</table> <br />
				<div class="shoppingCar_subtitle">
					&nbsp;&nbsp;<input type="checkbox" onclick="changChecked()"
						id="selectDefault" /> 默认注册时的地址及电话
				</div> <!-- <form action="updateCustomAtShop.action" id="updateCustomForm" name="updateCustomForm"> -->
				<div style="margin-top:30px;width:600px">
					<div>
						<font color="blue">*</font>写收件人：<input type="text" id="username"
							name="receiveName" onblur="checkUsername()"
							onfocus="usernameFocus()" value="写收件人真实姓名" style="color:#8a8a8a" />
						<font id="usernameMsg" color="blue"></font>
					</div>
					<div>
						<table>
							<tr>
								<td>收件地址：</td>
								<td><select style="float: left;" id="selProvance"
									name="receiveProvince"
									onchange="chgProvinces('selProvance','selCity','selArea')"></select>
									<select style="margin-left: 10px; float: left;" id="selCity"
									name="receiveCity" onchange="chgCitys('selCity','selArea')"></select>
									<select id="selArea" name="area"
									style="margin-left: 10px; float: left;"></select>
								</td>
							</tr>
						</table>
					</div>
					<div>
						<font color="blue">*</font>详细地址：<input type="text" id="address"
							name="address" onblur="checkkAddress()" /> <font id="addressMsg"
							color="blue"></font>
					</div>
					<div>
						<font color="blue">*</font>邮政编码：<input type="text" id="mail"
							name="postCode" onblur="checkMail()" onfocus="mailFocus()"
							value="写6位邮政编码" style="color:#8a8a8a" /> <font id="mailMsg"
							color="blue"></font>
					</div>
					<div>
						&nbsp;电话号码：<input type="text" style="width:40px;"
							onblur="checkPhone()" id="specialplane1" name="phone1" />-<input
							type="text" onblur="checkPhone()" id="specialplane2"
							name="phone2" /><font id="specialplaneMsg" color="blue">如：0000-12345678</font>
					</div>
					<div>
						<font color="blue">*</font>手机号码：<input type="text" id="telephone"
							name="mobilePhone" onblur="checkMobile()" /> <font
							id="telephoneMsg" color="blue"></font>
					</div>
					<div>
						<table>
							<tr>
								<td id="makeSure1">&nbsp;<input type="button"
									style="border-style:dashed" value="确定"
									onclick="checkAllInput()" />
								</td>
								<td id="makeSure2" style="display:none">&nbsp;<input
									type="button" style="border-style:dashed" value="返回修改"
									onclick="backToCheck()" />
								</td>
							</tr>
						</table>
					</div>
				</div> <!-- </form> -->
				<div class="shoppingCar_subtitle">&nbsp;&nbsp;付款方式</div>
				<div class="shoppingCar_right_pic">
					<input type="checkbox" /> <img src="img/shoppingCar_zhifubao.png"
						width="20%" />
				</div> <br />
				<div class="shoppingCar_right_pic">
					<input type="button" value="☜ 保存设计" onclick="showGetOrderContent()" />
					<input type="button" value="直接付款 ☞" />
				</div></td>
		</tr>
	</table>

	<jsp:include page="bottom.jsp"></jsp:include>
	<%-- <div id="ContentArray" title="订单备注">
	如果需要，您可以对订单加备注<br/><form action=""><fieldset>
	<c:forEach items="${cuslist}" var="re">
		${re.customName}：<input type="text" name="ordercontent" value="${re.customContent}"/><br/>
	</c:forEach></fieldset></form>
</div> --%>
</body>
</html>